﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="../Scripts/jquery.js"></script>
<script type="text/javascript" src="../Scripts/Verify.js"></script>
<link href="../Styles/Public.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>首尾字符验证</h1>
<h2>概述</h2>
<div class="desc">
  <p>设置录入的内容必须以某字符开头或结属，在控件上设置 <strong>begin</strong>或<strong>end</strong>实现该功能。</p>
  <p>常见的应用场景，如录入网址，可以http://开头或https://开头</p>
  <p>&lt;input name=&quot;&quot; type=&quot;text&quot; <strong>begin=&quot;http|https&quot;</strong>/&gt;</p>
  <p>&lt;input name=&quot;&quot; type=&quot;text&quot; <strong>end=&quot;@qq.com&quot;</strong>/&gt;（必须是qq邮箱）</p>
</div>
<h2>示例</h2>
<h3>1、验证以某字符开头</h3>
<div class="desc">
  <fieldset>
    
    <pre>&lt;form onsubmit=&quot;alert('验证成功');return false;&quot;&gt;<br />      &lt;p&gt; 下载地址：<br />        &lt;input name=&quot;&quot; type=&quot;text&quot; <strong>begin=&quot;http://|https://|ftp://&quot;</strong> nullable=&quot;false&quot; /&gt;<br />      &lt;/p&gt;<br />      &lt;p&gt;<br />        &lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证表单&quot; verify=&quot;true&quot;/&gt;<br />      &lt;/p&gt;<br />    &lt;/form&gt;</pre>
    <form onsubmit="alert('验证成功');return false;">
      <p> 下载地址：
        <input name="" type="text" begin="http://|https://|ftp://" nullable="false" />
      </p>
      <p>
        <input type="submit" name="button" class="button" value="验证表单" verify="true"/>
      </p>
    </form>
  </fieldset>
  
</div>
<h3>2、验证以某字符结尾</h3>
<div class="desc">
  <fieldset>
    
    <pre>&lt;form onsubmit=&quot;alert('验证成功');return false;&quot;&gt;<br />      &lt;p&gt; 邮箱：<br />        &lt;input name=&quot;&quot; type=&quot;text&quot; value=&quot;&quot; nullable=&quot;false&quot; <strong>end=&quot;@qq.com&quot;</strong> alt=&quot;请输入QQ邮箱&quot; /&gt;<br />      &lt;/p&gt;<br />      &lt;p&gt;<br />        &lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证表单&quot; verify=&quot;true&quot;/&gt;<br />      &lt;/p&gt;<br />    &lt;/form&gt;</pre>
    <form onsubmit="alert('验证成功');return false;">
      <p> 邮箱：
        <input name="" type="text" value="" nullable="false" end="@qq.com" alt="请输入QQ邮箱" />
      </p>
      <p>
        <input type="submit" name="button" class="button" value="验证表单" verify="true"/>
      </p>
    </form>
  </fieldset>
  
</div>
</body>
</html>
